package com.shxy.rlzy.controller;

import com.shxy.rlzy.common.lang.Result;
import com.shxy.rlzy.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: tanhao
 * @Description: 测试控制器
 * @DateTime: 8/16/2021 12:27 PM
 **/
@RestController
public class TestController {
    @Autowired
    IUserService userService;
    @Autowired
    BCryptPasswordEncoder bCryptPasswordEncoder;

    @GetMapping("/test")
    public Result test() {
        return Result.succ(userService.list());
    }

    @GetMapping("/test/pass")
    public Result pass() {
        String pass = bCryptPasswordEncoder.encode("111111");
        return Result.succ(pass);
    }
}
